package com.example.fivecheergame;

import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
    private Button btnStart;
    private Button btnDefeat;
    private Button btnRule;
    private MyView myView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        myView = findViewById(R.id.myView);

        btnStart = findViewById(R.id.btn_restart);
        btnStart.setBackgroundColor(Color.parseColor("#A7BBC7"));
        btnStart.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                myView.reStart();
            }
        });

        btnDefeat = findViewById(R.id.btn_defeat);
        btnDefeat.setBackgroundColor(Color.parseColor("#A7BBC7"));
        btnDefeat.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                myView.defeat();
            }
        });

        btnRule =findViewById(R.id.btn_rule);
        btnRule.setBackgroundColor(Color.parseColor("#A7BBC7"));
        btnRule.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                myView.rule();
            }
        });
    }
}